package org.nepu.sc.mx;

import cn.hutool.core.util.StrUtil;
import org.lboot.core.exception.BusinessException;
import org.springframework.http.HttpStatus;

import java.util.List;

public class MxUtil {
    public static SafeMx filterMx(List<SafeMx> mxList, String rateId){
        int len = mxList.size();
        for (SafeMx mx:mxList){
            if (mx.getRateId().equals(rateId)){
                return mx;
            }
        }
        throw new BusinessException(HttpStatus.NOT_FOUND, StrUtil.format("未找到:【{}】对应评价矩阵", rateId));
    }
}
